<template>
    <div>
        APP
        <!-- 注意这里自定义事件不要写成handleEvent()形式,
            可以写成handleEvent或者handleEvent($event)或者$event => handleEvent($event) -->
        <!-- 方式一 -->
        <!-- <Child @toChildEvent="handleEvent"></Child> -->
        <!-- 方式二 -->
        <!-- <Child @toChildEvent="handleEvent($event)"></Child> -->
        <!-- 方式三 -->
        <Child @toChildEvent1="$event => handleEvent1($event)" @toChildEvent2="handleEvent2"></Child>

    </div>
</template>

<script>
import Child from './Child.vue';
export default {
    components: {
        Child
    },
    methods: {
        handleEvent1(data) {
            console.log("app-event1", data);
        },
        handleEvent2(data1, data2) {
            console.log("app-event2", data1, data2);
        }
    }
}

</script>